/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
 *
 * @author duonghung1369
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "User", propOrder= {
    "id",
    "username",
    "password",
    "is_admin",
    "create_date",
    "update_date",
    "is_deleted",
    "orders",
    "profile"    
})
@XmlRootElement(name = "User")
public class User implements Serializable {
    @XmlElement(name = "UserId", required = true)
    private int id;
    @XmlElement(required = true)
    private String username;
    @XmlElement(required = true)
    private String password;
    @XmlElement(required = true)
    private boolean is_admin;
    private Date create_date;
    private Date update_date;
    @XmlElement(required = true)
    private boolean is_deleted;
    private List<Order> orders;
    @XmlElement(namespace="http://xml.netbeans.org/schema/Profile")
    private Profile profile;

    public User() {
    }

    

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    /**
     * @param username the username to set
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return the is_admin
     */
    public boolean isIs_admin() {
        return is_admin;
    }

    /**
     * @param is_admin the is_admin to set
     */
    public void setIs_admin(boolean is_admin) {
        this.is_admin = is_admin;
    }

    /**
     * @return the create_date
     */
    public Date getCreate_date() {
        return create_date;
    }

    /**
     * @param create_date the create_date to set
     */
    public void setCreate_date(Date create_date) {
        this.create_date = create_date;
    }

    /**
     * @return the update_date
     */
    public Date getUpdate_date() {
        return update_date;
    }

    /**
     * @param update_date the update_date to set
     */
    public void setUpdate_date(Date update_date) {
        this.update_date = update_date;
    }

    /**
     * @return the is_deleted
     */
    public boolean isIs_deleted() {
        return is_deleted;
    }

    /**
     * @param is_deleted the is_deleted to set
     */
    public void setIs_deleted(boolean is_deleted) {
        this.is_deleted = is_deleted;
    }

    /**
     * @return the orders
     */
    public List<Order> getOrders() {
        if (orders == null){
            orders = new ArrayList<Order>();
        }
        return orders;
    }

    /**
     * @param orders the orders to set
     */
    public void setOrders(List<Order> orders) {
        this.orders = orders;
    }

    /**
     * @return the profile
     */
    public Profile getProfile() {
        
        return profile;
    }

    /**
     * @param profile the profile to set
     */
    public void setProfile(Profile profile) {
        this.profile = profile;
    }

    
}
